Documentation > CMS Template API Library > Asset > RouteCollection(List[Int32],Status,Boolean)

RouteCollection

Route assets in the given list of collection to a workflow step that corresponds to the given status. The status must correspond to one of the steps on the assets' workflow. If more than one workflow step has the given state, then the lowest step will be chosen. Use Status.Load(string statusName) to load the status. If it returns false, check the context.Error property. Currently, you may only route file assets, routing folders in not supported.

public CrownPeak.CMSAPI.RouteResponse RouteCollection(List[Int32],Status,Boolean)


Returns

RouteResponse.

Parameters

NameDescriptionType
CollectionIds The list of Collection Ids to route the assets within them. List<Int32>
status The status. CrownPeak.CMSAPI.Status
publishDependencies Applies only when workflow results in a publish. If true, dependencies will be computed and published if necessary. System.Boolean

Code Example

C#

Sample:
// Move the asset to the workflow step that has status set to "LIVE".
RouteResponse rr = Asset.Route(myCollectionIds, oLiveStatus);
if (rr.HasError)
{
  Out.WriteLine("Route failed: " + rr.ErrorMessage);
}

Connect with Crownpeak